package Vista;
import java.awt.BorderLayout;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.LayoutStyle;

import javax.swing.WindowConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.SwingUtilities;

import Controlador.ControEstudiante;
import Controlador.ControReportes;

public class Vreportes extends javax.swing.JFrame {

	public Vreportes() {
		super();
		initGUI();
	}
	public ControReportes contr;
	public JPanel panelrep;
	public JTable tbareporte;
	public JButton btngenerar;

	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				panelrep = new JPanel();
				getContentPane().add(panelrep, BorderLayout.CENTER);
				GroupLayout panelrepLayout = new GroupLayout((JComponent)panelrep);
				panelrep.setLayout(panelrepLayout);
				{
					btngenerar = new JButton();
					btngenerar.setText("Generar Reporte");
				}
				{
					TableModel tbareporteModel = 
						new DefaultTableModel(
								new String[][] { { "cedula", "Nombre" , "Apellido" }},
								new String[] { "Column 1", "Column 2" , "Column 3"});
					tbareporte = new JTable();
					tbareporte.setModel(tbareporteModel);
				}
				panelrepLayout.setHorizontalGroup(panelrepLayout.createSequentialGroup()
					.addContainerGap(36, 36)
					.addGroup(panelrepLayout.createParallelGroup()
					    .addGroup(panelrepLayout.createSequentialGroup()
					        .addComponent(tbareporte, GroupLayout.PREFERRED_SIZE, 316, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 0, Short.MAX_VALUE))
					    .addGroup(GroupLayout.Alignment.LEADING, panelrepLayout.createSequentialGroup()
					        .addGap(82)
					        .addComponent(btngenerar, GroupLayout.PREFERRED_SIZE, 140, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 94, Short.MAX_VALUE)))
					.addContainerGap(38, 38));
				panelrepLayout.setVerticalGroup(panelrepLayout.createSequentialGroup()
					.addContainerGap(17, 17)
					.addComponent(tbareporte, GroupLayout.PREFERRED_SIZE, 160, GroupLayout.PREFERRED_SIZE)
					.addGap(40)
					.addComponent(btngenerar, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					.addContainerGap(18, Short.MAX_VALUE));
			}
			pack();
			this.setSize(400, 287);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	
	acontroladora();
	

}
private void acontroladora() {
	
	contr = new ControReportes(this);
	btngenerar.addActionListener(contr);

}
}
